package com.heima.admin.controller;

import com.heima.admin.service.LoginService;
import com.heima.model.admin.dtos.AdminLoginDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author earl
 * @Data 2024/8/21上午10:53
 * @Version 1.0
 */
@RestController
@RequestMapping("/admin")
@Slf4j
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 登录请求
     * @param dto
     * @return
     */
    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody AdminLoginDto dto){
        log.info("到登录咯");
       return loginService.login(dto);
    }

}